#include<bits/stdc++.h>

using namespace std;

int main()
{
	string s, t;
	cin >> s;
	getchar();
	getline(cin, t);
	s = ' ' + s + ' ';
	t = ' ' + t + ' ';
	
	for(char &ch : s) ch = tolower(ch);
	for(char &ch : t) ch = tolower(ch);
	
	int cnt = 0, f = 0;
	if(t.find(s) == -1)
	{
		cout << -1 << endl;
	}
	else
	{
		f = t.find(s);
		int pos = 0;
		while(t.find(s, pos) != -1)
		{
			pos = t.find(s,pos);
			cnt++;
			
			pos++;
		}
			cout << cnt << " " << f << endl;
	}
		

	return 0;
} 
